<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
Object obj=request.getSession().getAttribute("role_resource");
if(null==obj){
	response.setStatus(1000);
	return;
}
%> 
	<script type="text/javascript">
		//外包商状态下拉列表
		var state_store = new Ext.data.JsonStore({
			fields : [ "id", "text" ],
			data : [ {
				id : "0",
				text : "禁用"
			}, {
				id : "1",
				text : "启用"
			}]
		});
		//外包商列表数据源
		var data_store = new Ext.data.JsonStore({
			root: "data",
        	totalProperty: "total",
			fields: ["id", "name", "linkman", "linkphone","linkaddr", "state",
					"ftp", "port", "ftpuser", "ftppass", "ftppath", "remark"],
        	url: "epiboly!list.action"
    	});
		
		//定义数据显示面板
		var p1 = {
			id: "p1",
			xtype: "grid",
			stripeRows: true,
			loadMask: true,
			autoExpandColumn: "remark",
			autoExpandMin: 100,
			store: data_store,
			headersDisabled: true,
			columns:[
    	    	new Ext.grid.RowNumberer({header: "序号", width: 35}),
   					{header: "编号",			dataIndex: "id",	menuDisabled: true},
   					{header: "名称",			dataIndex: "name",	menuDisabled: true},
   					{header: "联系人",		dataIndex: "linkman",	menuDisabled: true},
   					{header: "联系电话",		dataIndex: "linkphone",	menuDisabled: true},
   					{header: "联系地址",		dataIndex: "linkaddr",	menuDisabled: true},
   					{header: "状态",			dataIndex: "state",	menuDisabled: true,
    					renderer:function(input){
	   						 if(""==input)return input;
	            			 var res2=state_store.getById(input);
							 return res2.data.text;
            		  	}
            		},
   					{header: "FTP地址",		dataIndex: "ftp",	menuDisabled: true},
   					{header: "FTP端口",		dataIndex: "port",	menuDisabled: true},
   					{header: "FTP用户名",	dataIndex: "ftpuser",	menuDisabled: true},
   					{header: "FTP路径",		dataIndex: "ftppath",	menuDisabled: true},
   					{header: "备注",			dataIndex: "remark",	id: "remark",	menuDisabled: true}
			],
			buttonAlign: "center",
			bbar: new Ext.ux.PagingToolbar({
   	        	pageSize: limit,
   	        	store: data_store
   	    	})
		};

	
	data_store.load({params:{start:0,limit:limit}});
		
	var CenterPanel=Ext.getCmp("CenterPanel");
	CenterPanel.removeAll();
	CenterPanel.add(p1);
	CenterPanel.doLayout();
</script>